<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取cookie信息</title>
    <script>
        console.log(document.cookie);
        let cooks = document.cookie;
        let cook = cooks.split(';');
        let username = cook[1];
        let password = cook[2];
        console.log(username);
        let value = username.split('=')[1];
        console.log(value)
        console.log(password);
        let value1 = password.split('=')[1];
        console.log(value1);
    </script>
</head>
<body>
    {{cookie}}
    <br>
    {{cookie.username}} {{cookie.password}}
</body>
</html>